package def

import "kumachan/interpreter/lang/common/source"

func CategorizeResources(all (map[string] source.Resource)) (map[string] map[string] source.Resource) {
	var result = make(map[string] map[string] source.Resource)
	for path, item := range all {
		var this_kind_map, exists = result[item.Kind]
		if !(exists) {
			this_kind_map = make(map[string] source.Resource)
			result[item.Kind] = this_kind_map
		}
		this_kind_map[path] = item
	}
	return result
}


